<template>
  <div>
    <button
      type="button"
      class="details-button"
      style="width:70px; height:40px;"
      data-toggle="modal"
      data-target=".bs-example-modal-lg"
    >详情</button>

    <div
      class="modal fade bs-example-modal-lg"
      style="color: black;"
      tabindex="-1"
      role="dialog"
      aria-hidden="true"
    >
      <div class="modal-dialog modal-lg">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">
              <span aria-hidden="true">×</span>
            </button>
            <div>这里写标题</div>
          </div>
          <div>
            这是我写的内容<br>
            三月就这样来了，掩了冬梅的清红，再静静的绿了一树树的柳蔓<br>
            在我上下班的路上有一段被我当作田园小径的道路<br>
            我爱走在那里的感觉，冬天有梅：红梅、白梅都有，春天有梨花、桃花，<br>
            还有我不知道名的花草，错落的生长在我安静的世界里<br>
            每天都会很感谢有它们陪着我...<br>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "largeModal",
  created() {
    var animateButton = function(e) {
      e.preventDefault;
      //reset animation
      e.target.classList.remove("animate");

      e.target.classList.add("animate");
      setTimeout(function() {
        e.target.classList.remove("animate");
      }, 700);
    };
    var classname = document.getElementsByClassName("details-button");
    for (var i = 0; i < classname.length; i++) {
      classname[i].addEventListener("click", animateButton, false);
    }
  }
};
</script>

<style>
.details-button {
  font-family: "Helvetica", "Arial", sans-serif;
  display: inline-block;
  font-size: 14px;
  margin-top: 10px;
  margin-bottom: 10px;
  -webkit-appearance: none;
  appearance: none;
  background-color: #11cef0d8;
  color: #fff;
  /* 圆角的程度 */
  border-radius: 4px;
  border: none;
  cursor: pointer;
  position: relative;
  /* 过渡 */
  transition: transform ease-in 0.1s, box-shadow ease-in 0.25s;
  box-shadow: 0 2px 25px rgba(233, 163, 223, 0.6);
}
.details-button:focus {
  outline: 0;
}
.details-button:before,
.details-button:after {
  position: absolute;
  content: "";
  display: block;
  width: 70%;
  height: 50%;
  left: -20%;
  z-index: -1000;
  transition: all ease-in-out 0.5s;
  background-repeat: no-repeat;
}
.details-button:before {
  display: none;
  top: -75%;
  background-image: radial-gradient(circle, #11cef0d8 20%, transparent 20%),
    radial-gradient(circle, transparent 20%, #11cef0d8 20%, transparent 30%),
    radial-gradient(circle, #11cef0d8 20%, transparent 20%),
    radial-gradient(circle, #11cef0d8 20%, transparent 20%),
    radial-gradient(circle, transparent 10%, #11cef0d8 15%, transparent 20%),
    radial-gradient(circle, #11cef0d8 20%, transparent 20%),
    radial-gradient(circle, #11cef0d8 20%, transparent 20%),
    radial-gradient(circle, #11cef0d8 20%, transparent 20%),
    radial-gradient(circle, #11cef0d8 20%, transparent 20%);
  background-size: 10% 10%, 20% 20%, 15% 15%, 20% 20%, 18% 18%, 10% 10%, 15% 15%,
    10% 10%, 18% 18%;
}
.details-button:after {
  display: none;
  bottom: -75%;
  background-image: radial-gradient(circle, #11cef0d8 20%, transparent 20%),
    radial-gradient(circle, #11cef0d8 20%, transparent 20%),
    radial-gradient(circle, transparent 10%, #11cef0d8 15%, transparent 20%),
    radial-gradient(circle, #11cef0d8 20%, transparent 20%),
    radial-gradient(circle, #11cef0d8 20%, transparent 20%),
    radial-gradient(circle, #11cef0d8 20%, transparent 20%),
    radial-gradient(circle, #11cef0d8 20%, transparent 20%);
  background-size: 15% 15%, 20% 20%, 18% 18%, 20% 20%, 15% 15%, 10% 10%, 20% 20%;
}
.details-button:active {
  transform: scale(0.9);
  background-color: #11cef0d8;
  box-shadow: 0 2px 25px rgba(255, 0, 130, 0.2);
}
.details-button.animate:before {
  display: block;
  animation: topBubbles ease-in-out 0.75s forwards;
}
.details-button.animate:after {
  display: block;
  animation: bottomBubbles ease-in-out 0.75s forwards;
}

@keyframes topBubbles {
  0% {
    background-position: 5% 90%, 10% 90%, 10% 90%, 15% 90%, 25% 90%, 25% 90%,
      40% 90%, 55% 90%, 70% 90%;
  }
  50% {
    background-position: 0% 80%, 0% 20%, 10% 40%, 20% 0%, 30% 30%, 22% 50%,
      50% 50%, 65% 20%, 90% 30%;
  }
  100% {
    background-position: 0% 70%, 0% 10%, 10% 30%, 20% -10%, 30% 20%, 22% 40%,
      50% 40%, 65% 10%, 90% 20%;
    background-size: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
  }
}
@keyframes bottomBubbles {
  0% {
    background-position: 10% -10%, 30% 10%, 55% -10%, 70% -10%, 85% -10%,
      70% -10%, 70% 0%;
  }
  50% {
    background-position: 0% 80%, 20% 80%, 45% 60%, 60% 100%, 75% 70%, 95% 60%,
      105% 0%;
  }
  100% {
    background-position: 0% 90%, 20% 90%, 45% 70%, 60% 110%, 75% 80%, 95% 70%,
      110% 10%;
    background-size: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
  }
}
</style>